//Name:
//Purpose:
//Author: wjy
//Date: 2022-01-11 20:21:11
//From:

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int year1, year2, month1, month2, day1, day2;
    printf("Enter first date (mm/dd/yy): ");
    scanf("%d/%d/%d", &month1, &day1, &year1);
    printf("Enter second date (mm/dd/yy): ");
    scanf("%d/%d/%d", &month2, &day2, &year2);
    if (year1 < year2)
    {
        printf("%d/%d/%.2d is earlier than %d/%d/%.2d\n", month1, day1, year1, month2, day2, year2);
    }
    if (year1 > year2)
    {
        printf("%d/%d/%.2d is earlier than %d/%d/%.2d\n", month2, day2, year2, month1, day1, year1);
    }
    if (year1 == year2)
    {
        if (month1 < month2)
        {
            printf("%d/%d/%.2d is earlier than %d/%d/%.2d\n", month1, day1, year1, month2, day2, year2);
        }
        if (month1 > month2)
        {
            printf("%d/%d/%.2d is earlier than %d/%d/%.2d\n", month2, day2, year2, month1, day1, year1);
        }
        if (month2 == month1)
        {
            if (day1 < day2)
            {
                printf("%d/%d/%.2d is earlier than %d/%d/%.2d\n", month1, day1, year1, month2, day2, year2);
            }
            if (day1 > day2)
            {
                printf("%d/%d/%.2d is earlier than %d/%d/%.2d\n", month2, day2, year2, month1, day1, year1);
            }
            if (day2 == day1)
            {
                printf("No earlier date.\n");
            }
        }
    }
    system("pause");
    return 0;
}